package com.itlong.cloud.enumerate;

import com.itlong.cloud.enumerate.ecode.ErrorCode;
import lombok.Getter;
import lombok.Setter;

/**
 * <desc>
 *      云设备错误码定义
 * </desc>
 *
 * @createDate 2017/10/2722
 */
public enum CloudDeviceErrorCodeEnum {

	/**
	 * mainCode为6表示云对讲模块错误，subCode可用范围为1至999；
	 */
    CLOUD_TTOKEN_IS_NULL(6,99,"token不能为空"),
	CLOUD_LOGIN_ERROE(6,101,"未登录"),
    CLOUD_DEVICE_TYPE_ERROR(6,102,"无法识别的设备类型"),
    CLOUD_IOT_REGISTER_ERROR(6,103,"阿里云没有该设备信息，请重新登录认证"),
    CLOUD_PAGE_ERROR(6,104,"分页参数不能为空"),
    CLOUD_PROJECT_IS_BANNED(6,116,"项目已禁用"),
    CLOUD_PROJECT_INTERCOM_IS_BANNED(6,117,"项目未开启云对讲"),
    CLOUD_PROJECT_ELEVATOR_IS_BANNED(6,118,"项目未开启云电梯"),
    CLOUD_CARDID_NOT_EXISTS(6,119,"卡号不存在"),
    CLOUD_USER_BALANCE_LESS(6,120,"用户余额不足"),
    CLOUD_SN_NOT_EXIST(6,181,"设备sn不存在"),
    CLOUD_LICENSE_ERROR(6,182,"物业端设备参数未配置"),
    CLOUD_SN_IS_BANNED(6,183,"设备已被禁用"),
    CLOUD_SN_ERROR(6,184,"设备端与云端配置不匹配，请重新登录认证"),
    CLOUD_SN_DECRYPT_ERROR(6,98,"token解密失败"),
    CLOUD_SN_IS_NULL(6,200,"sn不能为空"),
    CLOUD_DIN_IS_NULL(6,201,"din不能为空"),
    CLOUD_QQANDTINY_IS_NULL(6,202,"云端接收QQ与TinyID映射信息json不能为空"),
    CLOUD_QQANDTINY_ERROR(6,203,"云端接收QQ与TinyID映射信息json格式不正确"),
    CLOUD_QQANDTINY_NOT_FOUND(6,185,"云端用户未注册，请稍后上传"),
    CLOUD_RECORD_TYPE_IS_NULL(6,186,"通行记录类型不能为空"),
    CLOUD_PUSH_PASS_RECORD_IS_NULL(6,204,"云端接收设备端的通行记录映射信息json不能为空"),
    CLOUD_PUSH_PHONE_PASS_RECORD_ERROR(6,205,"云端接收设备端的通行记录映射信息json格式不正确"),
    CLOUD_ADDITIONAL_INFO_TYPE_IS_NULL(6,206,"云对讲附加信息类型不能为空"),
    CLOUD_CHANGE_LOG_ORDER_ID_IS_NULL(6,207,"云设备轮询命令id不能为空"),
    CLOUD_PUSH_TO_PHONE_ADDR_IS_NULL(6,208,"被推送的地址不能为空"),
    CLOUD_PUSH_TO_PHONE_SIP_IS_NULL(6,209,"被推送的sip账号不能为空"),
    CLOUD_USER_SIP_NOT_FIND(6,210,"没有匹配到住户"),
    CLOUD_PUSH_TO_PHONE_ALL_FAILED(6,211,"云对讲推送消息失败"),
    CLOUD_DYNAMIC_PWD_INVALID(6,212,"动态密码无效"),
    CLOUD_TINY_ID_IS_NULL(6,213,"TinyID不能为空"),
    CLOUD_TINY_ID_USER_NO_PERMISSION(6,214,"没有权限"),
    CLOUD_PROJECT_NOT_EXIST(6,215,"项目不存在"),
    CLOUD_PUSH_PASS_RECORD_TYPE_INVALID(6,216,"云端接收设备端的通行记录类型不合法"),
    CLOUD_BAIDUID_IS_NULL(6,217,"百度指纹码不能为空"),
    CLOUD_PASSWORD_IS_NULL(6,221,"获取授权文件密码不能为空"),
    CLOUD_DEVICE_MAC_IS_NULL(6,222,"设备不存在，获取授权文件失败"),
    CLOUD_PASSWORD_IS_ERROR(6,223,"授权密码错误，获取授权文件失败"),
    //云门禁
    CLOUD_ENTRANCE_SN_ERROR(6,251,"控制器管控门禁不存在"),
    CLOUD_BAIDUCODE_IS_EMPTY(6,218,"未使用的百度识别授权码不足！"),
    CLOUD_BAIDUCODE_IS_NOT_BUY(6,219,"此设备未查询到有效的激活码！"),
    CLOUD_TALK_DEVICEID_IS_USERD(6,220,"机号已被占用！"),
    CLOUD_ELEVATOR_PROP_NULL_ERROR(6,301,"上报属性不能为空"),
    CLOUD_ROOM_DYNAMIC_PWD_INVALID(6,302,"该房间的业主被冻结,动态密码无效"),
    CLOUD_MAC_IS_NULL(6,303,"MAC不能为空"),
    CLOUD_ELEVATOR_PUSH_ALARM_NULL_ERROR(6,304,"告警事件上报不能为空"),
    CLOUD_TIME_IS_ERROR(6,224,"密码已过期，获取授权文件失败"),
    CLOUD_FILE_IS_NULL(6,225,"授权文件的有效次数已用完"),
    CLOUD_TIMES_IS_NULL(6,226,"授权密码次数用完"),
    CLOUD_MAC_IS_ERROR(6,227,"设备激活异常,%s"),
    CLOUD_SN_IS_ERROR(6,228,"sn格式不合法"),
    //云电梯
    CLOUD_ELEVATOR_ILLEGAL_REQUEST(6,250,"云电梯请求非法篡改"),

    //受限设备
    CLOUD_LIMITED_DEVICE_ERROR(6,401,"受限设备")


    ;

    @Setter
    @Getter
    private ErrorCode errorCode = new ErrorCode();



	CloudDeviceErrorCodeEnum(){}

    /** 主错误码与错误信息构造函数
     *
     * @param mainCode
     */
	CloudDeviceErrorCodeEnum(Integer mainCode, String codeMsg) {
        errorCode.setMainCode(mainCode);
        errorCode.setSubCode(0);
        errorCode.setCodeMsg(codeMsg);
    }

    /** 全参构造函数
     *
     * @param mainCode
     * @param subCode
     */
	CloudDeviceErrorCodeEnum(Integer mainCode, Integer subCode, String codeMsg){
        errorCode.setMainCode(mainCode);
        errorCode.setSubCode(subCode);
        errorCode.setCodeMsg(codeMsg);
    }

}
